function network_errors = network_dimensioning( input, output, cycles, granularity )
% NETWORK DIMENSIONIG : This function iterates to find the best net
% dimension
% INPUT :    input matrix tu be used as net input
%           output vector used as network desired output
%           cycles number of cycle to iterate
%           granularity number of hidden layer to increase for each
%           iteration
%  OUTPUT : vector where elements represent the perfermonces of network
%            trained whith different number of neurons in the hidden layer

%FIRST : CREATE OUTPUT VECTOR 
network_errors = zeros(1,cycles);

%SECOND : ITERATION 
%        1. Create temporary input vector deleting the feature of index i
%        2. Create and train the network withe the temp input
%        3. Save network performance in the output at index i

for i=1:cycles,
    [temp_net, temp_tr ] = create_fit_net(input',output',i*granularity);
    network_errors(1,i) = temp_tr;
end